/* K手发布 api */
import request from '@/utils/request';
import {object2Url} from "@/utils/trans";

// 获取任务发布账号【所有】(未使用）
export async function publishList(type) {
  const ts = new Date().getTime();
  const ua = navigator.userAgent;
  const us = {
    ts,
    ua,
    type: type
  };
  // ${object2Url(us)} get 链接传值
  let url = `/business/matrix/publishaccount/list${object2Url(us)}`
  const res = await request.get(url, us);
  if (res.data.code === 2000) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.message));
}

// K手发布任务
export async function addKuaishou (data) {
  const res = await request.post('/business/matrixkspublish/add', data)
  if (res.data.code === 2000) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.msg));
}

